Skip to content

Conversation

@mackermedia
Copy link

I'm a recent migrant from Sublime Text and love your package.

However, I'm proposing adding a few more ERB block types, specifically ones that support stripping whitespace.

Via ActionView::Base Documentation:
"When on a line that only contains whitespaces except for the tag, <% %> suppress leading and trailing whitespace, including the trailing newline. <% %> and <%- -%> are the same. Note however that <%= %> and <%= -%> are different: only the latter removes trailing whitespaces."

@joseramonc
Copy link
Owner

@mackermedia thank you, since <% %> and <%- -%> are the same, I don't think it's worth to have both because it'd be more painful to iterate over all erb blocks, personally I like most the first one. Can you remove one of them?

The other erb blocks looks like great additions 😄

@mackermedia
Copy link
Author

Eh, you're right. It looks like now <% %> and <%- -%> are the same. It looks like the other two (the ones with trailing -% will in fact strip newlines that follow, but I'm not sure it's worth it. I'm okay with closing this since I don't have strong feels.

@joseramonc
Copy link
Owner

Personally I don't use erb blocks that strip newlines. If you use them or want to have them I'd merge them when you update this pull request

@mackermedia
Copy link
Author

Meh, I decided I'm not passionate about them for now. Will reopen if I feel like it in the future. Thanks for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants